package IC.lir.instructions;
import IC.lir.operands.RegOperand;
import IC.lir.*;


/**
 * ArrayLength instruction
 * Usage: ArrayLength Op1, Op2 
 * Op1: Imm, Mem, Reg
 * Op2: Reg
 */
public class ArrayLengthInstr extends Instruction {

	private RegOperand		array;
	private RegOperand 		dest;

	/**
	 * 
	 * @param array the array to get length info from
	 * @param dest the destination register
	 */
	public ArrayLengthInstr(RegOperand array, RegOperand dest) {
		this.array = array;
		this.dest = dest;
	}
	
	/**
	 * @return the array
	 */
	public RegOperand getArray() {
		return array;
	}

	/**
	 * @return the dest
	 */
	public RegOperand getDest() {
		return dest;
	}

	@Override
	public <D,U> U accept(Visitor<D,U> v, D context) {
		return v.visit(this,context);
	}
}
